home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / Dots & Pixels / sources / vretrace.c < prev    next >
C/C++ Source or Header  |  1995-09-29  |  598b  |  27 lines

  1. // #include <Retrace.h>
  2. //
  3. // This is the VBL routine which must be present in 'VBL ' resource #128
  4. // for class 'vretrace' to work properly
  5. //
  6. // Note for PowerMac users: the vertical retrace manager isn't native
  7. // yet under System 7.5.1, so running this in 68K assembly is the fastest
  8. // we can do for now.
  9. //
  10. void main( void)
  11. {
  12.     asm {
  13.         ;
  14.         ; the VBL_proc proper:
  15.         ;
  16.         ; ensure that we will be restarted:
  17.         ;
  18.         MOVE.W        -0x06(A0),D0        ; our VBL count
  19.         LEA            0x0A(A0),A1            ; find address of vblCount
  20.         MOVE.W        D0,(A1)                ; reset
  21.         ;
  22.         ; Increase numtimes_run:
  23.         ;
  24.         ADDQ.L        #0x01,-0x04(A0)
  25.     }
  26. }
  27.